package com.itheima.mapper;

import com.itheima.pojo.Order;
import com.itheima.pojo.vo.OrderMobileVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface OrderMapper {

    /**
     * 添加预约信息
     * @param order
     * @return
     */
    @Insert("insert into `order`(member_id, order_date, order_type, order_status, setmeal_id) " +
            "values (#{memberId}, #{orderDate}, #{orderType}, #{orderStatus}, #{setmealId})")
    Integer insert(Order order);


    /**
     * 根据预约id查询预约信息
     * @param id
     * @return
     */
    @Select("select * from `order` where id = #{id}")
    Order selectById(Integer id);

    /**
     * 根据预约id查询预约信息
     * @param id
     * @return
     */
    OrderMobileVO selectOrderVOById(Integer id);
}
